﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using SATF.BI;

namespace SATF
{
    public class LogonInfosSingleton : Dictionary<string,LogonInfo>
    {
        private static LogonInfosSingleton m_instance;
        LogonInfosSingleton() { }
        public static LogonInfosSingleton instance
        {
            get
            {
                if (m_instance == null)
                {
                    m_instance = new LogonInfosSingleton();
                }
                return m_instance;
            }
        }

        public static void AddItem(LogonInfo info)
        {
            if (m_instance.ContainsKey(info.UserName))
            {
                m_instance[info.UserName] = info;
            }
            else
            {
                m_instance.Add(info.UserName, info);
            }
        }


        public static void SetLogonInfosSingleton(LogonInfosSingleton value)
        {
            m_instance = value;
        }
    }
}